<?php
include("config.php");
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" /><!--如果是IE8时强制以IE7显示-->
<meta name="keywords" content=""><!--SEO关键字-->
<meta name="description" content=""><!--SEO描述-->
<link rel ="" href=""><!--选项卡图标-->
<title></title>
<link rel="stylesheet" href="css/base.css">
<link rel="stylesheet" href="css/style.css">
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="js/script.js"></script>
</head>

<body class="pr">
	<div class="lo_top">
		<div class="dib qh">
			<!-- <a href="" class="qh_bo dib">登&nbsp&nbsp录</a> -->
			<a href="login.php?pageid=<?php echo $_GET['pageid'];?>" class="qh_bo dib" >登&nbsp&nbsp陆</a>
			<a href="index.php" class="qh_bo dib">浏&nbsp&nbsp览</a>
		</div>
		<div class="login_logo"><a class="login_lo dib"><img class="fl" width="210px" height="90px" alt="logo" src="img/logo1.png"></a></div><!-- LOGO -->
	</div>

	<div class="pa_login">
			<form name="myform" method="POST">
				<div class="lo_in pr">
					<span class="input_ico dib fl"></span><input class="mail_pw fl dib js_focusSelector" type="text" name="user_mail" id="user_mail" value="" /><label class="js_inputTips pa" for="user_mail">邮箱</label>
				</div>
				<div class="lo_in pr">
					<span class="input_ico dib fl fouse" style=""></span><input class="mail_pw fl dib js_focusSelector" type="password" name="user_pwd" id="user_pwd" value="" /><label class="js_inputTips pa" for="user_pwd">密码</label>
				</div>	
				<div class="lo_in pr">
					<span class="input_ico dib fl fouse" style=""></span><input class="mail_pw fl dib js_focusSelector" type="password" name="user_pwd1" id="user_pwd1" value="" /><label class="js_inputTips pa" for="user_pwd1">重复密码</label>
				</div>		
				<div id="s_mail" class="er"></div>
				<div id="s_pwd" class="er"></div>
				<div class="login_button">
					<input class="lo_re_bo dib" type="submit" name="submit" value="注&nbsp&nbsp&nbsp&nbsp&nbsp册" id="submit">
				</div>				
			</form>
		<div class="login_help">
			<a href=""class="f12 for">忘记密码？</a>	
			<span class="f12 for">&nbsp|&nbsp&nbsp </span>
			<span class="f12 for choose_login">其他方式登录</span>	
		</div>	
	</div>
	
	<div class="login_another none w pa tc">
		<a class="login_renren" href="#">人人网</a>
		<a class="login_qq" href="http://www.kuaipaila.com/qqsdk/oauth/qq_login.php">QQ</a>
		<a class="login_douban" href="#">豆瓣</a>
		<a class="login_weibo" href="https://api.weibo.com/oauth2/authorize?client_id=1573692200&redirect_uri=http%3A%2F%2Fwww.kuaipaila.com%2Fwbsdk%2Fcallback.php&response_type=code">新浪微博</a>
		<a class="login_qqweibo" href="#">腾讯微博</a>
		<a class="login_msn" href="#">MSN</a>
	</div>
</body>



<script type="text/javascript">

	function refreshs(){
		document.getElementById("yzm_img").src="yzm.php?dumy="+Math.random();
		}
	var mail=0;
	var pwd=0;
	$("#user_mail").blur(checkmail);

	
	function checkmail(){
		var boo = false;
		if($("#user_mail").val()==''){$("#s_mail").html("<span><div class='fail'></div>用户名不能为空</span>");return false;}
		$.ajax({url:"register.class.php?request=1&user_mail="+$("#user_mail").val()+"",async:false,success:function(result){
			if(result=="true"){
				$("#s_mail").html("<div class='succed'></div>可以注册");
				boo = true;
			}else{
				$("#s_mail").html("<span>"+"<div class='fail'>"+"</div>"+result+"</span>");
				}
			}});
			return boo;
		}
		
	function checkpwd(){
		if($("#user_pwd").val() != $("#user_pwd1").val()){$("#s_mail").html("<span><div class='fail'></div>两次密码输入不同</span>");return false;}
		else{$("#s_mail").html("");return true}
		}
	
		
	$("#submit").click(function(){
		if(checkpwd() && checkmail()){
					$.ajax({url:"register.class.php?request=3&user_mail="+$("#user_mail").val()+"&user_pwd="+$("#user_pwd").val()+"",async:false,success:function(results){
						if(results=="true"&&getParam("pageid")==""){location.href="edit_user_info.php";}
						else if(results=="true"&&getParam("pageid")!=""){location.href="page.php?id="+getParam("pageid");}
						else{alert(results);}
						}});
			}
			else{$("#s_mail").html("<span>"+"<div class='fail'>"+"</div>信息有误</span>");}
			return false;
		});
		
	function getParam(paramName){
    paramValue = "";
    isFound = false;
    if (this.location.search.indexOf("?") == 0 && this.location.search.indexOf("=")>1)
    {
        arrSource = unescape(this.location.search).substring(1,this.location.search.length).split("&");
        i = 0;
        while (i < arrSource.length && !isFound)
        {
            if (arrSource[i].indexOf("=") > 0)
            {
                 if (arrSource[i].split("=")[0].toLowerCase()==paramName.toLowerCase())
                 {
                    paramValue = arrSource[i].split("=")[1];
                    isFound = true;
                 }
            }
            i++;
        }   
    }
   return paramValue;
	}
	
	</script>